import pysrv
class Tick(pysrv.PyTickDelegate):
	def update(self):
		pass
class Server(pysrv.PyServerDelegate):
	def goInit(self):
		self.init(6008)

	def msgParseContent(self,id,content):
		print("server::msgParse",content)
		#task.sendString("haha")
		#task.sendString("haha111haha")
		self.sendString(id,"msgParseContent")
	def newTCPTask(self,id):
		self.sendString(id,"newTCPTask")
	def taskDestroyed(self,id):
		print("Server::taskDestroyed",id)

class Client(pysrv.PyClientDelegate):
	def goInit(self):
		self.init("127.0.0.1",6007)
		self.sendString("goInit")
	def connectGet(self):
		print("Client::connectGet")
	def msgParseContent(self,content):
		print("ClientTask::msgParse",content)
	def connectLoss(self):
		print("Client::connectLoss")

server = Server("PyGate")
server.goInit()

client =  Client()
client.goInit()
server.addClient(client)

tick = Tick(1)
server.addTick(tick)

server.start()



